<?php
namespace app\admin\validate;
use think\Validate;

class Proclamation extends Validate
{
    protected $rule = [
        'id' => 'require|number',
        'is_top' => 'require|number|in:0,1',
        'is_hide' => 'require|number|in:0,1',
        'sort' => 'require|number',
        'content' => 'require',
    ];

    protected $message = [
        'content.require' => '内容不能为空',
        'id.require' => '缺少必要参数',
        'id.number' => '缺少必要参数',
        'is_top.require' => '是否置顶不能为空',
        'is_top.number' => '是否置顶必须是数字',
        'is_top.in' => '是否置顶类型不正确',
        'is_hide.require' => '是否隐藏不能为空',
        'is_hide.number' => '是否隐藏必须是数字',
        'is_hide.in' => '是否隐藏类型不正确',
        'sort.require' => '排序不能为空',
        'sort.number' => '排序必须是数字',
    ];
}